<%--
  Created by IntelliJ IDEA.
  User: lym
  Date: 2021/1/12
  Time: 23:23
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<c:set var="webroot" value="${pageContext.request.contextPath}"/>
<html>
<head>
    <title>员工维护</title>
    <script src="${webroot}/element/vue.js"></script>
    <link rel="stylesheet" href="${webroot}/element/index.css">
    <script src="${webroot}/element/index.js"></script>
    <link rel="stylesheet" type="text/css" href="${webroot}/styles/basc.css">
</head>
<body>
<div id="app">
    <%@ include file="../includes/hear.jsp" %>

    <div style="float: left;width: 200px;">
        <%@ include file="../includes/menu.jsp" %>
    </div>
    <div class="operation" style="float: left;width: 800px;">验证信息↓：<span class="Mess" id="Mess">${sessionScope.Mess}</span>
        <div class="operation" style="margin-left: 10px;margin-bottom: 10px;padding-top: 10px;">
        </div>
        <center>
            <table>
                <tr>
                    <td ALIGN="center">
                        <el-button type="primary" @click="add" style="width: 100px;">添加员工<i
                                class="el-icon-upload"></i></el-button>
                        <el-button type="primary" @click="selectAll" style="width: 100px;">返回全部<i
                                class="el-icon-upload"></i></el-button>
                    </td>
                </tr>
                <tr>
                    <td align="center">
                        <el-input v-model="key" placeholder="请输入要查询的用户名"></el-input>
                        <el-button type="primary" @click="select" style="width: 100px;">查询<i
                                class="el-icon-upload"></i></el-button>
                    </td>
                </tr>
            </table>
        </center>
        <table class="dt" border="0" cellspacing="1">
            <tr>
                <th>序号</th>
                <th>用户名</th>
                <th>姓名</th>
                <th>性别</th>
                <th>修改</th>
                <th>删除</th>
            </tr>
            <c:forEach items="${sessionScope.pm.data}" var="record" varStatus="rows">
                <tr>
                    <td>${(pm.pageNo-1)*pm.pageSize+rows.count}</td>
                    <td>${record.username}</td>
                    <td>${record.ename}</td>
                    <td>${record.ssex}</td>
                    <td><a href="${webroot}/man.do?action=upgo&username=${record.username}">修改</a></td>
                    <td><a href="${webroot}/man.do?action=delete&username=${record.username}">删除</a></td>
                </tr>
            </c:forEach>
        </table>
        <div class="pagenav">${sessionScope.pm.pageNav}</div>
    </div>


</div>
</body>
<STYLE>
    #app {
        width: 1280px;
        margin: 0 auto;
    }
</STYLE>
<script>
    new Vue({
        el: '#app',
        data:{
          key:""
        },
        methods: {
            add() {
                window.location.href = '${webroot}/man_manage/man_add.jsp';
            },
            selectAll() {
                window.location.href = '${webroot}/man.do?action=selectAll';
            },
            select() {
                var log = {
                    key:this.key
                }
                window.location.href = '${webroot}/man.do?action=selectONE&key=' + JSON.stringify(log);
            },
        }

    })
</script>
</html>
